<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<html lang="en">
	<head>
	    <meta charset="UTF-8">
	    <script type="text/javascript" src="/statics/js/jquery-3.1.0.min.js"></script>
	    <style type="text/css">
	    	td{text-align: center;}
	    </style>
	    <script type="text/javascript">
	    	$(function(){
	    		$('.delete-a').click(function(){
	    			window.location.href='/student/delete.htm?id='+ $(this).data('id');
	    		});
	    	})
	    	
	    </script>
	</head>
	<body>
		<div style="width: 100%;">
		<a href="/student/input.htm">新增</a>
		<a href="/student/login_form.htm">登入</a>
		<br/>
		search <br/>
		<form action="/student/list.htm" method="post">
			username: <input type="text" name="username" value="${username}"/>
			<input type="submit" value="search"/>
		</form>
			<table border="1">
			<table border="1" style="width: 100%;">
				<tr>
					<td>序号</td>
					<td>用户名</td>
					<td>密码</td>
					<td>昵称</td>
					<td>编辑</td>
				</tr>
				<c:forEach items="${students}" var="u">
				<tr>
					<td>${u.id}</td>
					<td>${u.username}</td>
					<td>${u.password}</td>
					<td>${u.nickname}</td>
					<td><a href="/student/input.htm?id=${u.id}">编辑</a> | <a class="delete-a" href="#" data-id="${u.id}">删除</a></td>
				</tr>
				</c:forEach>
			</table>
		</div>
	</body>
</html>